package com.GainLoop.Api.Entity;

import java.util.ArrayList;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.google.gson.Gson;
import com.google.gson.JsonArray;

public abstract class ArrayEntity<T extends EntityAbstract> extends ArrayList<T> {
	
	private static final long serialVersionUID = 625610891360321923L;
	

	public JSONArray toJsonArray() throws JSONException
	{
		JSONArray arr = new JSONArray();
		
		for(T t: this) {
			arr.put(t.toObject());
		}
		
		return arr;
	}
	
}
